10 'PROGRAM PRTPRICE TO PRINT PRICING SERVICE FILES
20 CLS:LOCATE 2,17,0:PRINT "Program PRTPRICE To List Pricing Service File"
30 LOCATE 5,10:PRINT "Enter the drive letter for the location of the price file ";:COLOR 0,7:PRINT " ";:LOCATE ,POS(0)-1,1:D$="":WHILE D$="":D$=INKEY$:WEND:PRINT D$:COLOR 7,0
40 IF ASC(D$)=27 THEN CLS:LIST 260:KEY ON:END
50 IF ASC(D$)=13 THEN INPUT "Do you wish to stop (Y/N)";A$:IF A$ = "N" OR A$ = "n" THEN GOTO 20 ELSE SYSTEM
60 PRINT:PRINT "N = National Price Service File"
70 PRINT:PRINT "T = Trade Service Corporation Service File"
80 PRINT:PRINT "A = Trade Service Of Australia File"
90 PRINT:PRINT "I = Trade Service Information (UK) File"
100 PRINT:INPUT "Enter Code";C$
110 A=ASC(C$):IF A > 96 AND A < 123 THEN C$ = CHR$(A-32)
120 IF C$="" GOTO 50
130 IF C$ = "N" THEN L=128:F$="NPS01.DAT"
140 IF C$ = "T" THEN L=128:F$="TRADE.DAT"
150 IF C$ = "I" THEN L=130:F$="CPSTESTC.DAT"
160 IF C$ <> "A" GOTO 190
170 PRINT:PRINT " Enter data file name ? ";:Y=POS(0):COLOR 0,7:PRINT " ";:LOCATE ,Y,1:INPUT "",F$:COLOR 7,0
180 L=162
190 F$=D$+":"+F$
200 ON ERROR GOTO 380
210 OPEN F$ FOR INPUT AS #1:CLOSE #1 'Test to see if file exists
220 OPEN F$ AS #1 LEN=L:ON ERROR GOTO 0
230 FIELD #1, 128 AS PRTLINE$
240 WIDTH "LPT1:", 132:ON ERROR GOTO 0
250 LOCATE 20,1,0:PRINT "Press Esc to stop printing at any time . . ."
260 LPRINT CHR$(15)
270 RECNUM = 0
280 WHILE NOT EOF(1) 'loops between here and WEND
290 A$=INKEY$:IF LEN(A$) > 0 THEN IF ASC(A$)=27 THEN CLOSE:SYSTEM
300 RECNUM = RECNUM + 1
310 GET #1, RECNUM
320 LPRINT PRTLINE$
330 WEND 'goes past this when End Of File is reached
340 LPRINT CHR$(18)+CHR$(12) 'shut off compressed print and Form Feed
350 CLOSE #1
360 IF C$ = "I" AND MID$(F$,3) = "CPSTESTC.DAT" THEN F$ = D$+":CPSTESTR.DAT" : GOTO 200
370 SYSTEM
380 RESUME 390
390 IF MID$(F$,3) = "CPSDISK3.DAT" THEN F$ = D$+":CPSDISK5.DAT" : GOTO 200
400 IF MID$(F$,3) = "CPSDISK5.DAT" THEN F$ = D$+":CPSTESTC.DAT" : GOTO 200
410 PRINT:PRINT "Can't locate the file ";F$
420 PRINT "Strike any key to end program" : A$="" : WHILE A$="" : A$=INKEY$ : WEND